#include "board.h"
#include "..\..\..\src\polsys.h"


//static u8 mPWMCONBakup;

void Board_Sleep()
{
    Adc_Disable();
    //mPWMCONBakup = PWMCON;
    //PWMCON = 0;
    Wdt_Clear();
    Wdt_Disable();
    PORTA;
    PORTB;
    if((!OVAL)&&(Btn_IsDown() == Board_ButtonIsDown())) // 休眠之前再判断一次唤醒管脚电平，降低错误休眠概率。
    {
        SLEEP();       
    }
    /*NOP();*/
    Adc_Enable();
    //PWMCON = mPWMCONBakup;
    Wdt_Enable();
}




